//
//  DLAlipayPayOrAuthToolsShareManager.h
//  DLSharePaySDK
//
//  Created by Dracy on 2019/8/20.
//  Copyright © 2019 dl_hzk. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NSString * DLAlipayPayToolsParameterKey NS_STRING_ENUM;
FOUNDATION_EXTERN DLAlipayPayToolsParameterKey const DLAlipayPayToolsParameterAPPIDKey;
FOUNDATION_EXTERN DLAlipayPayToolsParameterKey const DLAlipayPayToolsParameterPartnerIDKey;
FOUNDATION_EXTERN DLAlipayPayToolsParameterKey const DLAlipayPayToolsParameterBussinessAPIKey;

FOUNDATION_EXTERN DLAlipayPayToolsParameterKey const DLAlipayPayToolsParameterOrderRequestStringKey; //服务器拼好的支付请求串
FOUNDATION_EXTERN DLAlipayPayToolsParameterKey const DLAlipayPayToolsParameterAPPSchemeKey;//应用注册scheme,在AliSDKDemo-Info.plist定义URL types
typedef void(^DLAlipayPayManagerBack)(id errStr);

@interface DLAlipayPayOrAuthToolsManager : NSObject


+ (instancetype)sharedInstance;


#pragma mark - 支付/授权

//-------------------------通用---------------

/**
 是否是支付
 */
+ (BOOL)dl_isHandlePayURL:(NSURL *)theURL;

/**
handle open url
*/
- (BOOL)dl_handleOpenURL:(NSURL *)theURL;

/**
 handle open url
 */
- (BOOL)dl_handleOpenURL:(NSURL *)theURL universalLink:(NSUserActivity *)userActivity;

/*
 支付宝授权
 */
- (void)dl_AlipayWithAuthParameter:(id)parameter schemeKey:(NSString *)schemeKey callBack:(DLAlipayPayManagerBack)payBack;


//-----------------------------支付宝----------------------------

/**
 支付宝支付 - 必须设置: CGPayToolsParameterOrderRequestStringKey; CGPayToolsParameterAPPSchemeKey;
 */

- (void)dl_AlipayPayWithParameters:(NSDictionary <DLAlipayPayToolsParameterKey, id> *)theParam schemeKey:(NSString *)schemeKey response:(nonnull void (^)(NSDictionary * _Nullable, NSError * _Nullable))theResponse;

@end

NS_ASSUME_NONNULL_END
